using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.CommandBars;

using SQLString.Dialogs;
using SQLString.AppResource;
using System.Windows.Forms;

namespace SQLString.Classes
{
	public class CommonFuntions
	{

		public void SetCusror(cursorMode CM, Form frm)
		{
			switch(CM){
				case cursorMode.Default:
					frm.Cursor= Cursors.Default;
					break;
				case cursorMode.Wait:
					frm.Cursor = Cursors.WaitCursor;
					break;
			}
		}

		/// <summary>
		/// Displays the common UI list.
		/// </summary>
		/// <param name="szlistItems">array of string objects to be placed into the UI ListBox Class.</param>
		/// <param name="szTitleText">The string title to be applied to the UI Dialog Caption.</param>
		/// **********************************************************************************************************
		/// *	JBH Software Systems
		/// *	Project:	
		/// *	Copyright (C) 2008- 
		/// *
		/// *	Source Code is Property of 
		/// *	Coder:	jeffrey.hamlin
		/// *	EMAIL:	this.notNULL@gmail.com/this@jeffhamlin.com
		/// *	URL:	www.jeffhamlin.com
		/// *	
		/// *	SYS:EVENTYNE.6/23/2008
		/// *
		/// *********************************************************************************************************
		public void DisplayCommonList( string[] szlistItems, string szTitleText )
		{
			try
			{
				fCommList fList = new fCommList();
				if (szlistItems.Length > 0)
				{
					foreach (string szItem in szlistItems)
					{
						fList.lstCommon.Items.Add(szItem.Trim());
					}
					fList.Text = szTitleText;
					DialogResult dlgRST = fList.ShowDialog();
					fList.Dispose();
				}
			}
			catch (Exception ex)
			{
				Monitor.sErrMsg(ex.Message);
			}
		}

	}
}
